package com.bjpowernode.crm.workbench.service.impl;

import com.bjpowernode.crm.workbench.domain.Activity;
import com.bjpowernode.crm.workbench.mapper.ActivityMapper;
import com.bjpowernode.crm.workbench.service.ActivityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("activityService")
public class ActivityServiceImpl implements ActivityService {

    @Autowired
    private ActivityMapper activityMapper;


    public int saveCreateActivity(Activity activity) {
        return activityMapper.insertActivity(activity);
    }

    public List<Activity> queryActivityByConditionForPage(Map<String, Object> map) {
        return activityMapper.selectActivityByConditionForPage(map);
    }

    public int queryCountForActivityByCondition(Map<String, Object> map) {
        return activityMapper.selectCountOfActivityByCondition(map);
    }

    public int deleteActivityByIds(String[] ids) {
        return activityMapper.deleteActivityByIds(ids);
    }

    public Activity queryActivityById(String id) {
        return activityMapper.selectActivityById(id);
    }

    public int saveUpdateActivity(Activity activity) {
        return activityMapper.editActivity(activity);
    }

    public List<Activity> queryAllActivities() {
        return activityMapper.selectAllActivities();
    }

    public List<Activity> queryActivitiesById(String[] ids) {
        return activityMapper.selectActivitiesById(ids);
    }

    public int saveActivityByList(List<Activity> activityList) {
        return activityMapper.insertActivityByList(activityList);
    }

    public Activity queryActivityForDetailById(String id) {
        return activityMapper.selectActivityForDetailById(id);
    }

    public List<Activity> queryActivityByClueId(String clueId) {
        return activityMapper.selectActivityByClueId(clueId);
    }

    public List<Activity> queryActivityByNameAndClueId(Map<String, Object> map) {
        return activityMapper.selectActivityByNameAndClueId(map);
    }

    public List<Activity> queryActivityById(String[] ids) {
        return activityMapper.selectActivityByIds(ids);
    }

    public List<Activity> queryActivityConvertForActivityNameAndClueId(Map<String, Object> map) {
        return activityMapper.selectActivityConvertByIdAndActivityName(map);
    }
}
